<?php
 $link = mysqli_connect('localhost','root','root','test');
if(!$link){
    echo('数据库连接失败');
    die();
}
?>